//#include	"proto.h"
#include	"Command.h"
#include    "ParseUsage.h"
#include    "Mysocket.h"
#include    <stdio.h>
#include    <stdlib.h>
#include    <string.h>
#include    <errno.h>
#include    <fcntl.h>
#include    <sys/types.h>
#include    <sys/socket.h>
#include    <arpa/inet.h>
#include    <netdb.h>
#include    <netinet/in.h>
#include	<unistd.h>
#include    <signal.h>
#include    <pthread.h>
#include    <vector>

using namespace std;

int main (int argc, char *argv[]){
    char Command[LEN];
    
    if (argc != 3){
        perror("Usage:IP Port");
        exit(0);
    }
    
    int port= atoi(argv[2]);
    signal(SIGALRM,sig_alrm);
    ParseCommand1(port,argv[1]);

    if ('N' == flag){
        for( ; ; ){
            showCOMMAND();
            gets(Command);
            ParseCommand2(Command);
        }
    }
    return 0;
}

